package com.aspyn.tetris;

import android.app.Activity;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TetrisActivity extends Activity {//Manages GridManager and DrawView
    /** Called when the activity is first created. */
	private int screenWidth, screenHeight;
	private GridManager gridManager;
	private DrawView dv;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        //set up screen- this part must come first
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //Set up display variables
        Display display = getWindowManager().getDefaultDisplay();
        screenWidth = display.getWidth();
        screenHeight = display.getHeight();
        
        //Set up screen
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //add draw view and set up grid manager
        gridManager = new GridManager();
        gridManager.setUpGrid(screenWidth, screenHeight);
        
        LinearLayout layout1 = (LinearLayout)findViewById(R.id.layout1);
        
        dv = new DrawView(this, screenWidth, screenHeight, gridManager);
        
        layout1.addView(dv);
    }
}